<template>
  <div class="app-container">

    <div class="filter-container">

    </div>
    <my-table
      :grid-table-header="tableHeard"
      :table-data="tableData"
      :clikc-cell="clickCell"
      @rowClick="rowclik"
      @cellOnClick="cellClik"
    />
  </div>
</template>

<script>
import myTable from '@/components/Tables/index.vue'
import { api_account_names } from '@/api/pnl_analysis'

export default {
  components: { myTable },
  data() {
    return {

      clickCell: ['market_value'],
      tableData: [
        {
          'symbol': '000001.SZE',
          'delta_pnl': '-182891.625',
          'market_value': 3127873.5,
          'delta_fee': 412.1292114,
          'eq_total_res_pnl': '-101394.4531',
          'eq_intraday_res_pnl': 5742.541016,
          'eq_interday_res_pnl': '-107136.9922',
          'eq_total_fac_pnl': 0,
          'eq_intraday_fac_pnl': 0,
          'eq_interday_fac_pnl': 0
        },
        {
          'symbol': '000026.SZE',
          'delta_pnl': '-34709.375',
          'market_value': 954288,
          'delta_fee': 147.2666016,
          'eq_total_res_pnl': '-24147.89844',
          'eq_intraday_res_pnl': '-23863.43164',
          'eq_interday_res_pnl': '-284.4654846',
          'eq_total_fac_pnl': 0,
          'eq_intraday_fac_pnl': 0,
          'eq_interday_fac_pnl': 0
        },
        {
          'symbol': '000039.SZE',
          'delta_pnl': 37467.26563,
          'market_value': 3387936.5,
          'delta_fee': 408.909729,
          'eq_total_res_pnl': 1391.980713,
          'eq_intraday_res_pnl': '-2335.647705',
          'eq_interday_res_pnl': 3727.619873,
          'eq_total_fac_pnl': 0,
          'eq_intraday_fac_pnl': 0,
          'eq_interday_fac_pnl': 0
        },
        {
          'symbol': '000049.SZE',
          'delta_pnl': '-92250.51563',
          'market_value': 289917.9688,
          'delta_fee': 1988.206177,
          'eq_total_res_pnl': '-77946.02344',
          'eq_intraday_res_pnl': 19416.08398,
          'eq_interday_res_pnl': '-97362.10938',
          'eq_total_fac_pnl': 0,
          'eq_intraday_fac_pnl': 0,
          'eq_interday_fac_pnl': 0
        },
        {
          'symbol': '000050.SZE',
          'delta_pnl': 1830.483765,
          'market_value': 1591984.375,
          'delta_fee': 826.2225952,
          'eq_total_res_pnl': 1323.74707,
          'eq_intraday_res_pnl': 1402.929932,
          'eq_interday_res_pnl': '-79.18103027',
          'eq_total_fac_pnl': 0,
          'eq_intraday_fac_pnl': 0,
          'eq_interday_fac_pnl': 0
        },
        {
          'symbol': '000100.SZE',
          'delta_pnl': '-74812.08594',
          'market_value': 3256050.5,
          'delta_fee': 353.3580017,
          'eq_total_res_pnl': 45539.13281,
          'eq_intraday_res_pnl': '-3454.687988',
          'eq_interday_res_pnl': 48993.82813,
          'eq_total_fac_pnl': 0,
          'eq_intraday_fac_pnl': 0,
          'eq_interday_fac_pnl': 0
        },
        {
          'symbol': '000157.SZE',
          'delta_pnl': '-39233.34766',
          'market_value': 1357463,
          'delta_fee': 131.9682465,
          'eq_total_res_pnl': 4517.672363,
          'eq_intraday_res_pnl': 4842.641602,
          'eq_interday_res_pnl': '-324.969574',
          'eq_total_fac_pnl': 0,
          'eq_intraday_fac_pnl': 0,
          'eq_interday_fac_pnl': 0
        },
        {
          'symbol': '000333.SZE',
          'delta_pnl': '-457159.3125',
          'market_value': 7129928,
          'delta_fee': 3791.380615,
          'eq_total_res_pnl': '-144647.2813',
          'eq_intraday_res_pnl': 16998.09766,
          'eq_interday_res_pnl': '-161645.375',
          'eq_total_fac_pnl': 0,
          'eq_intraday_fac_pnl': 0,
          'eq_interday_fac_pnl': 0
        },
        {
          'symbol': '000498.SZE',
          'delta_pnl': 90325.05469,
          'market_value': 3438775.25,
          'delta_fee': 159.2998657,
          'eq_total_res_pnl': 47457.97656,
          'eq_intraday_res_pnl': 366.644104,
          'eq_interday_res_pnl': 47091.33203,
          'eq_total_fac_pnl': 0,
          'eq_intraday_fac_pnl': 0,
          'eq_interday_fac_pnl': 0
        },
        {
          'symbol': '000513.SZE',
          'delta_pnl': '-48077.85938',
          'market_value': 3286279.5,
          'delta_fee': 74.62358093,
          'eq_total_res_pnl': '-10557.1377',
          'eq_intraday_res_pnl': 219.1582489,
          'eq_interday_res_pnl': '-10776.29102',
          'eq_total_fac_pnl': 0,
          'eq_intraday_fac_pnl': 0,
          'eq_interday_fac_pnl': 0
        },
        {
          'symbol': '000526.SZE',
          'delta_pnl': '-29222.47656',
          'market_value': 2494555.5,
          'delta_fee': 161.3640137,
          'eq_total_res_pnl': '-18233.61133',
          'eq_intraday_res_pnl': '-527.1122437',
          'eq_interday_res_pnl': '-17706.49805',
          'eq_total_fac_pnl': 0,
          'eq_intraday_fac_pnl': 0,
          'eq_interday_fac_pnl': 0
        },
        {
          'symbol': '000555.SZE',
          'delta_pnl': '-50161.02734',
          'market_value': 1690954.75,
          'delta_fee': 323.6202393,
          'eq_total_res_pnl': '-36634.14063',
          'eq_intraday_res_pnl': 138.9711761,
          'eq_interday_res_pnl': '-36773.11328',
          'eq_total_fac_pnl': 0,
          'eq_intraday_fac_pnl': 0,
          'eq_interday_fac_pnl': 0
        },
        {
          'symbol': '000568.SZE',
          'delta_pnl': '-495800.2813',
          'market_value': 7034453,
          'delta_fee': 2423.839111,
          'eq_total_res_pnl': '-19404.87109',
          'eq_intraday_res_pnl': 2924.177734,
          'eq_interday_res_pnl': '-22329.04688',
          'eq_total_fac_pnl': 0,
          'eq_intraday_fac_pnl': 0,
          'eq_interday_fac_pnl': 0
        },
        {
          'symbol': '000581.SZE',
          'delta_pnl': '-85651.92188',
          'market_value': 3235367.25,
          'delta_fee': 98.23717499,
          'eq_total_res_pnl': '-39308.24609',
          'eq_intraday_res_pnl': '-66.62341309',
          'eq_interday_res_pnl': '-39241.625',
          'eq_total_fac_pnl': 0,
          'eq_intraday_fac_pnl': 0,
          'eq_interday_fac_pnl': 0
        },
        {
          'symbol': '000630.SZE',
          'delta_pnl': 0,
          'market_value': 223333.5938,
          'delta_fee': 33.50003815,
          'eq_total_res_pnl': 2281.027832,
          'eq_intraday_res_pnl': 2281.027832,
          'eq_interday_res_pnl': 0,
          'eq_total_fac_pnl': 0,
          'eq_intraday_fac_pnl': 0,
          'eq_interday_fac_pnl': 0
        },
        {
          'symbol': '000651.SZE',
          'delta_pnl': '-207134.6719',
          'market_value': 7402340,
          'delta_fee': 69.45178986,
          'eq_total_res_pnl': 102764.5781,
          'eq_intraday_res_pnl': '-470.9537964',
          'eq_interday_res_pnl': 103235.5234,
          'eq_total_fac_pnl': 0,
          'eq_intraday_fac_pnl': 0,
          'eq_interday_fac_pnl': 0
        },
        {
          'symbol': '000661.SZE',
          'delta_pnl': '-103819.4688',
          'market_value': 3160577,
          'delta_fee': 2955.102539,
          'eq_total_res_pnl': '-4973.865723',
          'eq_intraday_res_pnl': 20304.28125,
          'eq_interday_res_pnl': '-25278.14453',
          'eq_total_fac_pnl': 0,
          'eq_intraday_fac_pnl': 0,
          'eq_interday_fac_pnl': 0
        },
        {
          'symbol': '000690.SZE',
          'delta_pnl': 146699.0625,
          'market_value': 3493111.75,
          'delta_fee': 327.3969116,
          'eq_total_res_pnl': 120594.1719,
          'eq_intraday_res_pnl': 5399.948242,
          'eq_interday_res_pnl': 115194.2266,
          'eq_total_fac_pnl': 0,
          'eq_intraday_fac_pnl': 0,
          'eq_interday_fac_pnl': 0
        },
        {
          'symbol': '000723.SZE',
          'delta_pnl': '-160788.5625',
          'market_value': 3325006.5,
          'delta_fee': 2373.406738,
          'eq_total_res_pnl': '-271805.8125',
          'eq_intraday_res_pnl': '-75181.75',
          'eq_interday_res_pnl': '-196624.0469',
          'eq_total_fac_pnl': 0,
          'eq_intraday_fac_pnl': 0,
          'eq_interday_fac_pnl': 0
        },
        {
          'symbol': '000725.SZE',
          'delta_pnl': 40095.21094,
          'market_value': 3365230.5,
          'delta_fee': 112.0331116,
          'eq_total_res_pnl': 158452.125,
          'eq_intraday_res_pnl': '-3948.620605',
          'eq_interday_res_pnl': 162400.75,
          'eq_total_fac_pnl': 0,
          'eq_intraday_fac_pnl': 0,
          'eq_interday_fac_pnl': 0
        },
        {
          'symbol': '000728.SZE',
          'delta_pnl': '-5423.10791',
          'market_value': 3321055.75,
          'delta_fee': 92.3686142,
          'eq_total_res_pnl': 35960.71484,
          'eq_intraday_res_pnl': '-83.90384674',
          'eq_interday_res_pnl': 36044.62109,
          'eq_total_fac_pnl': 0,
          'eq_intraday_fac_pnl': 0,
          'eq_interday_fac_pnl': 0
        },
        {
          'symbol': '000733.SZE',
          'delta_pnl': '-144119.7188',
          'market_value': 3167614,
          'delta_fee': 198.7072601,
          'eq_total_res_pnl': '-46815.26953',
          'eq_intraday_res_pnl': 2370.329346,
          'eq_interday_res_pnl': '-49185.60156',
          'eq_total_fac_pnl': 0,
          'eq_intraday_fac_pnl': 0,
          'eq_interday_fac_pnl': 0
        },
        {
          'symbol': '000738.SZE',
          'delta_pnl': '-136226.5625',
          'market_value': 3196603.25,
          'delta_fee': 17.16633987,
          'eq_total_res_pnl': '-40760.02734',
          'eq_intraday_res_pnl': 538.2107544,
          'eq_interday_res_pnl': '-41298.23828',
          'eq_total_fac_pnl': 0,
          'eq_intraday_fac_pnl': 0,
          'eq_interday_fac_pnl': 0
        },
        {
          'symbol': '000739.SZE',
          'delta_pnl': 99486.5,
          'market_value': 3421814.5,
          'delta_fee': 29.5816555,
          'eq_total_res_pnl': 159530.8125,
          'eq_intraday_res_pnl': '-681.1737671',
          'eq_interday_res_pnl': 160212,
          'eq_total_fac_pnl': 0,
          'eq_intraday_fac_pnl': 0,
          'eq_interday_fac_pnl': 0
        },
        {
          'symbol': '000776.SZE',
          'delta_pnl': '-9931.070313',
          'market_value': 175231.4063,
          'delta_fee': 716.6506348,
          'eq_total_res_pnl': '-638.2183838',
          'eq_intraday_res_pnl': 374.353241,
          'eq_interday_res_pnl': '-1012.57135',
          'eq_total_fac_pnl': 0,
          'eq_intraday_fac_pnl': 0,
          'eq_interday_fac_pnl': 0
        }
      ],
      tableData2: [],
      tableHeard: {
        'symbol': 'symbol',
        'delta_pnl': 'delta_pnl',
        'market_value': 'market_value',
        'delta_fee': 'delta_fee',
        'eq_total_res_pnl': 'eq_total_res_pnl',
        'eq_intraday_res_pnl': 'eq_intraday_res_pnl',
        'eq_interday_res_pnl': 'eq_interday_res_pnl',
        'eq_total_fac_pnl': 'eq_total_fac_pnl',
        'eq_intraday_fac_pnl': 'eq_intraday_fac_pnl',
        'eq_interday_fac_pnl': 'eq_interday_fac_pnl'
      }
    }
  },
  methods: {
    get_account_names() {
      api_account_names()
        .then((response) => {
          // 请求数据这里换成所需要的接口
          // this.tableData = response.data
        })
        .catch((e) => {
          console.log(e)
        })
    },
    rowclik(row) {
      console.log(' rowClikc---callback----')
      console.log(row)
      console.log(row.name)
      console.log('跳转')
      this.$router.push({ name: 'demo', params: { account: '思达22号' }})
    },
    cellClik(row, column, cell, event) {
    }
  }
}
</script>

<style scoped>

</style>
